package com.hejjon.graph;

/**
 * @author: caoshi
 * @date: 2023-01-27 19:54:21
 * @since: 1.0
 */
public class Test {


    public static void main(String[] args) {

        int n = 5;
        String[] vertexs = new String[]{"A", "B", "C", "D", "E"};

        Graph graph = new Graph(n);

        // 插入图节点
        for (String vertex : vertexs) {
            graph.insertVertex(vertex);
        }

        // 添加边
        // A-B A-C B-C B-D B-E
        graph.insertEdge(0, 1, 1);
        graph.insertEdge(0, 2, 1);
        graph.insertEdge(1, 2, 1);
        graph.insertEdge(1, 3, 1);
        graph.insertEdge(1, 4, 1);

        graph.showGraph();


    }


}
